package action.user;

import java.util.Map;

import org.apache.struts2.ServletActionContext;

import service.UserService;
import bean.User;

import com.opensymphony.xwork2.ActionSupport;

public class ManageAction extends ActionSupport {
	private UserService userService;
	@Override
	public String execute() throws Exception {
		Map session=ServletActionContext.getContext().getSession();
		User u=(User) session.get("user");
		User user=userService.login(u);
		if(u==null)
			return INPUT;
		ServletActionContext.getRequest().setAttribute("user", user);
		return SUCCESS;
	}
	public UserService getUserService() {
		return userService;
	}
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
}
